<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="common/include :: header('员工新增')" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-post-add">
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">姓名：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="name" id="postName" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">邮箱：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="email" id="postCode" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">年龄：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="age" id="postSort" required>
				</div>
			</div>
<!--			<div class="form-group">-->
<!--				<label class="col-sm-3 control-label">性别：</label>-->
<!--				<div class="col-sm-8">-->
<!--					<select name="sex" class="form-control m-b" >-->
<!--						<option value="0">男</option>-->
<!--						<option value="1">女</option>-->
<!--						<option value="2">未知</option>-->
<!--					</select>-->
<!--				</div>-->
<!--			</div>-->

			<div class="form-group">
				<label class="col-sm-3 control-label">性别：</label>
				<div class="col-sm-8">
					<div class="radio-box" th:each="dict : ${@dict.getType('sys_user_sex')}">
						<input type="radio" th:id="${dict.id}" name="sex" th:value="${dict.value}" th:checked="${dict.isDefault}">
						<label th:for="${dict.id}" th:text="${dict.label}"></label>
					</div>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label is-required">是否超管：</label>
				<div class="col-sm-8">
					<div class="radio-box" th:each="dict : ${@dict.getType('emp_admin')}">
						<input type="radio" th:id="${dict.id}" name="admin" th:value="${dict.value}" th:checked="${dict.isDefault}">
						<label th:for="${dict.id}" th:text="${dict.label}"></label>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">预约时间：</label>
				<div class="col-sm-8">
					<div class="input-group date">
						<input class="form-control" type="text" name="hiredate"  placeholder="yyyy-MM-dd HH:mm" required>
						<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
					</div>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">所在部门：</label>
				<div class="col-sm-8">
					<select name="dept.id" class="form-control m-b" >
						<option th:each="u : ${departments}" th:text="${u.name}" th:value="${u.id}"></option>
					</select>
				</div>
			</div>

		</form>
	</div>
	<th:block th:include="common/include :: footer" />
	<th:block th:include="common/include :: datetimepicker" />
	<script type="text/javascript">
		var prefix = ctx + "/business/employee";
		
		function submitHandler() {
	        if ($.validate.form()) {
				// 保存信息 刷新表格
	        	// 若依的save方法，参数1：提交的地址 参数2：提交带的数据 参数3：回调函数（这里没有传）
	        	$.operate.save(prefix + "/add", $('#form-post-add').serialize());
	        }
	    }

		$("input[name='hiredate']").datetimepicker({
			format: "yyyy-mm-dd hh:ii",
			autoclose: true
		});
	</script>
</body>
</html>
